<template>
  <div>
    <!--transition标签 按钮出现附带动画-->
    <transition name="el-fade-in">
      <div class="page-component-up" @click="scrollToTop" v-show="topscrolltop >300" >
        <i class="iconfont">&#xe662;</i>
        <span>回到顶部</span>
      </div>
    </transition>
  </div>
</template>

<script>
export default {
  props:['topscrolltop'],
  data() {
    return {
      toTopShow: false
    };
  },
  methods: {
    scrollToTop () {
      this.$emit('scroll')
    }
    // handleScroll() {
 
  },

};
</script>
<style lang="scss" scoped >
.page-component-up {
  background-color: #fff;
  position: fixed;
  right: 50px;
  bottom: 150px;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
.iconfont {
  color: #666;
  font-size: 26px;
}
span {
  display: block;
  font-size:12px;
  color: #666;
  margin-top: 10px;
}
}
</style>